package com.rkc.feign;

import com.rkc.utils.JsonData;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Set;

/**
 * @author `RKC`
 * @date 2021/11/12 15:53
 */
@FeignClient(name = "shopping-product-service", contextId = "shopping-product-cart-service", path = "/api/cart/v1")
public interface ProductCartFeignService {

    /**
     * 获取购物车的最新价格（也会清空对应的购物车物品）
     * @param productIdSet
     * @return
     */
    @PostMapping("confirm_order_cart_item")
    JsonData confirmOrderCartItem(@RequestBody Set<Long> productIdSet);

    /**
     * 删除购物项，在用户支付成功后调用
     * @param productIdSet
     * @return
     */
    @PostMapping("deletions")
    JsonData deleteItemList(@ApiParam(value = "商品列表", required = true) @RequestBody Set<Long> productIdSet);
}
